function [VecGroupCoAuthors,nArticlePublished,nCoAuthors,ValueResultsPhD,VecResultsTotal,VecResultsOriginal,VecResultsReview,VecCoAuthorsBefore,VecCoAuthorsEditor,VecJournalEditorAfter,VecResultsArticleTemp3]=FilterAuthors2Test(ValueFolder,n2,ValueYearEditor,LowerBoundMonth,VecEditors1Temp,VecSpecialCharacters)

VecValueDateArticle=[];
VecValueDateArticle2=[];
ValueFolder2='/sps/isc/rneveu/EtudeIRM/Nature/ResultsEditor/';
nArticle=0;
VecResultsArticle={};
VecResultsAffiliation={};
VecResultsKeyWords={};
VecAffiliationAuthors=ExtractAffiliation(VecEditors1Temp{n2,7},VecSpecialCharacters);
VecResultsTotal=[];
VecResultsOriginal=[];
VecResultsReview=[];
VecJournal=[];
VecCoAuthorsBefore=[]; % Contains the number of co authors for a given editor in each article published before he became editor
VecJournalEditorAfter=[]; % Contains, in column 1 the article number in the block which has been published after the arival of the editor at Nature and in column 2, the block number
VecCoAuthorsEditor={}; % contains the position of the co author among all the papers published with the editor. Each column represents an independant author and each line a group of authors given by VecGroupCoAuthors
VecArticleType={'Academic Dissertation' 'Adaptive Clinical Trial' 'Clinical Trial' 'Comparative Study' 'Controlled Clinical Trial' 'Equivalence Trial' 'Evaluation Study' 'Journal Article' 'Meta-Analysis' 'Multicenter Study' 'Observational Study' 'Pragmatic Clinical Trial' 'Randomized Controlled Trial' 'Review' 'Statistics' 'Technical Report' 'Systematic Review' 'Twin Study' 'Validation Study'};
VecArticleType2={'Review' 'Systematic Review'};
n1Temp2=0;
% try
    ValueFile=['ResultsCharacteristicsTempEditor' num2str(n2) '.mat'];
    ValueTemp=dir([ValueFolder2 ValueFile]);
    if size(ValueTemp,1)>0
        load([ValueFolder2 ValueFile]);
        n1Temp2=n1;
    end
% end
n1Temp2=n1Temp2+1;
n1Temp2
for n1=n1Temp2:1062
    eval(sprintf('load([ValueFolder ''Results/ResultsFile%d.mat'']);',n1));
    eval(sprintf('VecValueTemp=VecResultEditors%d;',n2));
    n1
    for n3=1:size(VecValueTemp,1)
        ValueTemp=VecValueTemp{n3,1};
        if size(ValueTemp,2)>1
            [ValueFirst,ValueLast,ValueAffiliation,ValueORCID,nAuthors]=ExtractAuthor(ValueTemp,0,1);
%             if nAuthors>1
                VecResultsArticleTemp={};
                VecResultsArticleTemp(1,1)={1};
                VecResultsArticleTemp(1,2)={nAuthors-1};
                TestArticle=0;
                ValueAffiliationEditor='';
                ValueAffiliationTemp='';
                nAffiliation=0;
                VecResultsTotalTemp=zeros(1,6);
                VecResultsOriginalTemp=zeros(1,6);
                VecResultsReviewTemp=zeros(1,6);
                VecCoAuthorsEditorTemp=zeros(1,nAuthors-1);
                n42=1;
                for n41=1:nAuthors
                    [ValueFirst,ValueLast,ValueAffiliation,ValueORCID,nAuthorsTemp]=ExtractAuthor(ValueTemp,n41,2);
                    if size(ValueAffiliation,2)>1&&size(ValueAffiliationTemp,2)==0
                        ValueAffiliationTemp=ValueAffiliation;
                    else
                        if size(ValueAffiliation,2)>1&&size(ValueAffiliationTemp,2)>1
                            ValueResult=CompareAffiliation(ValueAffiliation,ValueAffiliationTemp);
                            if ValueResult==0
                                nAffiliation=nAffiliation+1;
                            end
                        end
                    end
                    if strcmps(double([VecEditors1Temp{n2,2} ' ' VecEditors1Temp{n2,1}]),double([ValueLast ' ' ValueFirst]),VecSpecialCharacters)<0.5||TestArticle>=1
                        if TestArticle==2
                            % We have already found the editor among authors with the editors affiliation corresponding to the one collected in the editor's biography
                            VecResultsArticleTemp(1,n42+2)={[ValueLast ' ' ValueFirst]};
                            VecCoAuthorsEditorTemp(1,n42)=n41;
                            n42=n42+1;
                        else
                            ValueResults=checkEditorAffiliation(ValueAffiliation,VecAffiliationAuthors);
                            if ValueResults==1&&strcmps(double([VecEditors1Temp{n2,2} ' ' VecEditors1Temp{n2,1}]),double([ValueLast ' ' ValueFirst]),VecSpecialCharacters)>0.99
                                % We have found again the editor
                                ValueAffiliationEditor=ValueAffiliation;
                                TestArticle=2;
                                VecCoAuthorsEditorTemp(1,n42)=NaN;
                                ValueArticleType=ComputeArticleType(VecValueTemp{n3,9},VecArticleType,VecValueTemp{n3,13},VecValueTemp{n3,14});
                                if ValueArticleType>0&&nAuthors>1
                                    VecResultsOriginalTemp(1,1)=1;
                                    VecResultsTotalTemp(1,1)=1;
                                    VecResultsOriginalTemp(1,6)=n41;
                                    VecResultsTotalTemp(1,6)=n41;
                                    if n41==1
                                        VecResultsOriginalTemp(1,2)=1;
                                        VecResultsTotalTemp(1,2)=1;
                                    else
                                        if n41<nAuthors
                                            if n41==2
                                                VecResultsOriginalTemp(1,3)=1;
                                                VecResultsTotalTemp(1,3)=1;
                                            else
                                                VecResultsOriginalTemp(1,4)=1;
                                                VecResultsTotalTemp(1,4)=1;
                                            end
                                        else
                                            VecResultsOriginalTemp(1,5)=1;
                                            VecResultsTotalTemp(1,5)=1;
                                        end
                                    end
                                else
                                    ValueArticleType=ComputeArticleType(VecValueTemp{n3,9},VecArticleType2,VecValueTemp{n3,13},VecValueTemp{n3,14});
                                    if ValueArticleType>0&&nAuthors>1
                                        VecResultsReviewTemp(1,1)=1;
                                        VecResultsTotalTemp(1,1)=1;
                                        VecResultsReviewTemp(1,6)=n41;
                                        VecResultsTotalTemp(1,6)=n41;
                                        if n41==1
                                            VecResultsReviewTemp(1,2)=1;
                                            VecResultsTotalTemp(1,2)=1;
                                        else
                                            if n41<nAuthors
                                                if n41==2
                                                    VecResultsReviewTemp(1,3)=1;
                                                    VecResultsTotalTemp(1,3)=1;
                                                else
                                                    VecResultsReviewTemp(1,4)=1;
                                                    VecResultsTotalTemp(1,4)=1;
                                                end
                                            else
                                                VecResultsReviewTemp(1,5)=1;
                                                VecResultsTotalTemp(1,5)=1;
                                            end
                                        end
                                    else
                                        VecResultsTotalTemp(1,1)=1;
                                        VecResultsTotalTemp(1,6)=n41;
                                        if n41==1
                                            VecResultsTotalTemp(1,2)=1;
                                        else
                                            if n41<nAuthors
                                                if n41==2
                                                    VecResultsTotalTemp(1,3)=1;
                                                else
                                                    VecResultsTotalTemp(1,4)=1;
                                                end
                                            else
                                                VecResultsTotalTemp(1,5)=1;
                                            end
                                        end
                                    end
                                end
                                VecResultsTotal(end,:)=VecResultsTotalTemp;
                                VecResultsOriginal(end,:)=VecResultsOriginalTemp;
                                VecResultsReview(end,:)=VecResultsReviewTemp;
                            else
                                % Other cases
                                VecCoAuthorsEditorTemp(1,n42)=n41;
                            end
                            VecResultsArticleTemp(1,n42+2)={[ValueLast ' ' ValueFirst]};
                            n42=n42+1;
                        end
                    else
                        % We have found the editor among authors for the first time
                        if TestArticle==0
                            TestArticle=1;
                            ValueAffiliationEditor=ValueAffiliation;
                            ValueResults=checkEditorAffiliation(ValueAffiliation,VecAffiliationAuthors);
                            if ValueResults==1
                                TestArticle=2;
                            end
                            VecCoAuthorsBefore=[VecCoAuthorsBefore;nAuthors-1];
                            VecJournal=[VecJournal;VecValueTemp(n3,4)];
                            ValueArticleType=ComputeArticleType(VecValueTemp{n3,9},VecArticleType,VecValueTemp{n3,13},VecValueTemp{n3,14});
                            if ValueArticleType>0&&nAuthors>1
                                VecResultsOriginalTemp(1,1)=1;
                                VecResultsTotalTemp(1,1)=1;
                                VecResultsOriginalTemp(1,6)=n41;
                                VecResultsTotalTemp(1,6)=n41;
                                if n41==1
                                    VecResultsOriginalTemp(1,2)=1;
                                    VecResultsTotalTemp(1,2)=1;
                                else
                                    if n41<nAuthors
                                        if n41==2
                                            VecResultsOriginalTemp(1,3)=1;
                                            VecResultsTotalTemp(1,3)=1;
                                        else
                                            VecResultsOriginalTemp(1,4)=1;
                                            VecResultsTotalTemp(1,4)=1;
                                        end
                                    else
                                        VecResultsOriginalTemp(1,5)=1;
                                        VecResultsTotalTemp(1,5)=1;
                                    end
                                end
                            else
                                ValueArticleType=ComputeArticleType(VecValueTemp{n3,9},VecArticleType2,VecValueTemp{n3,13},VecValueTemp{n3,14});
                                if ValueArticleType>0&&nAuthors>1
                                    VecResultsReviewTemp(1,1)=1;
                                    VecResultsTotalTemp(1,1)=1;
                                    VecResultsReviewTemp(1,6)=n41;
                                    VecResultsTotalTemp(1,6)=n41;
                                    if n41==1
                                        VecResultsReviewTemp(1,2)=1;
                                        VecResultsTotalTemp(1,2)=1;
                                    else
                                        if n41<nAuthors
                                            if n41==2
                                                VecResultsReviewTemp(1,3)=1;
                                                VecResultsTotalTemp(1,3)=1;
                                            else
                                                VecResultsReviewTemp(1,4)=1;
                                                VecResultsTotalTemp(1,4)=1;
                                            end
                                        else
                                            VecResultsReviewTemp(1,5)=1;
                                            VecResultsTotalTemp(1,5)=1;
                                        end
                                    end
                                else
                                    VecResultsTotalTemp(1,1)=1;
                                    VecResultsTotalTemp(1,6)=n41;
                                    if n41==1
                                        VecResultsTotalTemp(1,2)=1;
                                    else
                                        if n41<nAuthors
                                            if n41==2
                                                VecResultsTotalTemp(1,3)=1;
                                            else
                                                VecResultsTotalTemp(1,4)=1;
                                            end
                                        else
                                            VecResultsTotalTemp(1,5)=1;
                                        end
                                    end
                                end
                            end
                            VecResultsTotal=[VecResultsTotal;VecResultsTotalTemp];
                            VecResultsOriginal=[VecResultsOriginal;VecResultsOriginalTemp];
                            VecResultsReview=[VecResultsReview;VecResultsReviewTemp];
                        end
                    end
                end
                if TestArticle>=1
                    nArticle=nArticle+1;
                    VecKeyWordsTemp=ExtractKeyWords(VecValueTemp{n3,7});
                    for n41=1:size(VecKeyWordsTemp,2)
                        VecResultsKeyWords(nArticle,n41+1)=VecKeyWordsTemp(1,n41);
                    end
                    VecResultsKeyWords(nArticle,1)={size(VecKeyWordsTemp,2)};
                    VecResultsArticle(nArticle,1)={nArticle};
                    VecResultsArticle(nArticle,2)={nAuthors-1};
                    if size(ValueAffiliationEditor,2)>1
                        VecResultsAffiliation(nArticle,1)={ValueAffiliationEditor};
                    else
                        if nAffiliation==1
                            VecResultsAffiliation(nArticle,1)={ValueAffiliationTemp};
                        else
                            VecResultsAffiliation(nArticle,1)={''};
                        end
                    end
                    for n5=1:size(VecResultsArticleTemp,2)-2
                        VecResultsArticle(nArticle,n5+2)=VecResultsArticleTemp(1,n5+2);
                    end
                    VecCoAuthorsEditor(nArticle,1)={VecCoAuthorsEditorTemp};
                    ValueDate=VecValueTemp{n3,5};
                    [ValueYear,ValueMonth,ValueDay]=ExtractDate(ValueDate);
                    ValueDateArticleTemp=[{ValueYear} {ValueMonth} {ValueDay}];
                    if size(ValueDay,2)==0
                        ValueDay='01';
                    end
                    if size(ValueMonth,2)==0
                        ValueMonth='Jan';
                    end
                    if size(ValueYear,2)>0
                        VecValueDateArticle=[VecValueDateArticle;datenum([ValueDay '-' ValueMonth '-' ValueYear],'dd-mmm-yyyy')];
                        VecValueDateArticle2=[VecValueDateArticle2;ValueDateArticleTemp];
                    else
                        VecValueDateArticle=[VecValueDateArticle;NaN];
                        ValueDateArticleTemp=[{ValueYear} {ValueMonth} {ValueDay}];
                    end
                end
%             end
        end
    end
%     if mod(n1,100)==0
%         ValueFile=['ResultsCharacteristicsTempEditor' num2str(n2) '.mat'];
%         save([ValueFolder2 ValueFile]);
%     end
%     if mod(n1,5)==0
        ValueFile=['ResultsCharacteristicsTempEditor' num2str(n2) '.mat'];
        save([ValueFolder2 ValueFile],'-v7.3');
%     end
end

